package com.lwei.tallybook.client.controller;

import com.lwei.tallybook.base.domain.Account;
import com.lwei.tallybook.client.properties.GeneralProperties;
import com.lwei.tallybook.service.service.AccountService;
import com.lwei.tallybook.service.service.DictionaryService;
import org.apache.shiro.SecurityUtils;

import javax.annotation.Resource;

/**
 * 基础控制层
 * @author sks.lwei
 */
public class BaseController {

    @Resource
    protected GeneralProperties generalProperties;

    @Resource
    protected DictionaryService dictionaryService;

    @Resource
    protected AccountService accountService;

    /**
     * 获取当前用户
     */
    protected Account currentUser(){
        return (Account) SecurityUtils.getSubject().getPrincipal();
    }
}
